package reflect;

import reflect.annotations.AutoRunClass;

import java.util.Scanner;

public class Test4 {
    public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入一个类名称");
        String className=sc.nextLine();
        Class cla=Class.forName(className);
        if (cla.isAnnotationPresent(AutoRunClass.class)){
            Object obj=cla.newInstance();





        }else {
            System.out.println("该类未被标注");
        }
    }
}
